import Ember from 'ember';
import InfiniteScroll from '../../infinite-scroll';
const { taskApplyStatus_apply,taskApplyStatus_applySuc,taskApplyStatus_applyFail} = Constants;

export default Ember.Controller.extend(InfiniteScroll,{
  feedService: Ember.inject.service('feed-bus'),
  infiniteContentPropertyName: "customerList",
  infiniteModelName: "customer",
  infiniteContainerName:"customerContainer",
  curTabCode:"user",
 customerObs: function(){
   var _self = this;
   console.log("QQQQQ",_self.get('id'));
  //  this.get("store").findRecord('customer',_self.get('id')).then(function(customer){
  //    _self.set("customer",customer);
  //  });

 },
  actions:{
  goDetail(){
      //console.log("go detail");
      var mainpageController = App.lookup('controller:business.mainpage');
      mainpageController.switchMainPage('customer-info');
    },
  saveCustomer(customerInComp){
    var _self = this;
    //var customer=_self.store.createRecord('customer', customerInComp);
  customerInComp.save().then(function() {
        var mainpageController = App.lookup('controller:business.mainpage');
          mainpageController.switchMainPage('customer-service');
      //  _self.get("mainController").switchMainPage('customer-service');
    });
  },//保存按钮
   toAddPage(){
     alert("22222222");
     var mainpageController = App.lookup('controller:business.mainpage');
       mainpageController.switchMainPage('customer-add');
   },//添加基本信息
  }
});
